package com.ethink.system.api.constant;


import com.ethink.framework.common.constant.ResponseCodeEnum;

/**
 * 业务模块 api接口响应码
 *
 * @author yunduo
 **/
public enum SystemRespCode implements ResponseCodeEnum {
    //用户
    USER_IS_NOT_EXIST("100101", "登录用户不存在"),
    ACCOUNT_PASSWORD_ERR("100102", "账号密码错误"),
    USER_DISABLED("100103", "用户被禁用"),
    PASSWORD_ERR("100104", "密码错误"),
    LOGIN_NAME_DUPLICATION("100105", "账号已存在，请重新输入"),
    ADMIN_USER_DELETE("100106","管理员账户不允许被删除"),
    ADMIN_USER_UPDATE("100107","您没有足够的权限去修改系统管理员信息"),
    LOGIN_PHONE_DUPLICATION("100108", "手机号码已存在，请重新输入"),
    OLD_PWD_ERROR("100109", "您输入的旧密码错误，请重新输入"),

    //菜单
    MENU_IN_USE("100201","当前菜单下已有角色使用，或者存在下级菜单，无法删除"),
    MENU_IS_EXIST("100202","菜单或按钮名称重复"),
    API_AUTHORITY_IS_EXIST("100203","接口编码重复"),

    //角色
    ROLE_NAME_DUPLICATION("100301", "角色名称重复"),
    ADMIN_ROLE_UPDATE("100302","您没有足够的权限去修改系统管理员角色"),
    SYSTEM_ADMIN_ROLE_DELETE("100303","系统管理员角色不允许被删除"),
    MERCHANT_ADMIN_ROLE_DELETE("100304","平台商户角色不允许被删除"),
    MERCHANT_AGENT_ROLE_DELETE("100305","代理商户角色不允许被删除"),
    MERCHANT_CHANNEL_ROLE_DELETE("100306","合作渠道角色不允许被删除"),
    USER_IN_USE("100307","当前角色下已绑定用户(%s)，无法删除"),
    DEFAULT_ROLE_EXISTED("100308","当前权限类型已存在角色"),


    DATA_NOT_EXISTED("100400","数据不存在，非法请求"),


    WRONG_VALIDATE_CODE("100500","验证码输入错误"),

    //组
    ORGANIZATION_NAME_IS_REPEAT("110001","组织名称重复"),
    ORGANIZATION_ID_IS_NOT_EXIST("110002","组织id不存在"),
    ORGANIZATION_BIND_USER("110003","当前组织已绑定用户"),
    ORGANIZATION_HAVE_ITEM("110004","当前组织存在下级组织"),
    ;

    /**
     * 响应码
     */
    private String code;

    /**
     * 响应描述
     */
    private String message;

    /**
     * 构造函数
     *
     * @param code    响应码
     * @param message 响应描述
     */
    private SystemRespCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
